#include <glib.h>

GKeyFile *keyFile = NULL;

GKeyFile *
keyfile_get()
{
	return keyFile;
}

gint
keyfile_read()
{
	gchar *path;
	GError *err = NULL;
	gint flags = G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS;

	path = g_strdup_printf("%s/.famaconfig", g_get_home_dir());
	g_assert(path != NULL);

	keyFile = g_key_file_new();

	g_key_file_load_from_file(keyFile, path, flags, &err);

	if (err != NULL) {
		g_printerr("Unable to read file: %s\n", err->message);
		g_clear_error(&err);
		return FALSE;
	}

	return TRUE;
}

gint
keyfile_write()
{
	return TRUE;
}
